<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/commons/taglibs.jsp" %>
<%@ include file="/commons/script.jsp" %>
<script type="text/javascript" src="${ctx }/assets/js/pinyin_dict_notone.js"></script>
<script type="text/javascript" src="${ctx }/assets/js/pinyinUtil.js"></script>
<body>
<script>
jQuery(function($) {
	formvalidation("#addForm",{
		rules:{
			roleCode:{
				remote:{
					url:"${ctx}/acctRole/json/checkCode",
					data:{
						id:$("#id").val()
					}
				}
			}
		},
		messages:{
			roleCode:{
				remote:"<fmt:message key='AcctRole.error.codeExist'/>"
			}
		}
	})
	$("#saveBtn").click(function(){
		$("#addForm").submit();
	})
})
</script>
	<fmt:message key="label.pleaseInput" var="pleaseInput"></fmt:message>
	<fmt:message key="AcctRole.roleName.title" var="roleNameTitle"></fmt:message>
	<fmt:message key="AcctRole.roleCode.title" var="roleCodeTitle"></fmt:message>
	<fmt:message key="AcctRole.roleDesc.title" var="roleDescTitle"></fmt:message>
	<form:form action="${ctx }/acctRole/popup/save" id="addForm" name="addForm" modelAttribute="acctRole" method="post">
		<form:hidden path="id"/>
		<div class="form-group">
					<label class="control-label col-md-3"> <span class="required">*</span> 
					${roleNameTitle }:
					</label>
				<div class="col-md-6">
					<form:input path="roleName" cssClass="form-control required" maxlength="45" placeHolder='${pleaseInput } ${roleNameTitle }'/>
				</div>
		</div>
		<div class="form-group">
			
				<label class="control-label col-md-3"> <span class="required">*</span> 
				${roleCodeTitle }:
				</label>					
				<div class="col-md-6">
					<form:input path="roleCode" cssClass="form-control required" maxlength="45"  placeHolder="${pleaseInput } ${roleCodeTitle }"/>
				</div>
			
		</div>
		<div class="form-group">
				<label class="control-label col-md-3"> 
				${roleDescTitle }:
				</label>
				<div class="col-md-6">
					<form:input path="roleDesc" cssClass="form-control" maxlength="250" placeHolder="${pleaseInput } ${roleDescTitle }"/>
				</div>
		</div>
		
		<div class="form-group">	
				<div class="col-md-6">
					<a id="saveBtn" class="btn btn-primary"><fmt:message key="navigation.button.save"></fmt:message> </a>
					<a id="cancelBtn" class="btn btn-danger"  onclick="top.Dialog.close()"><fmt:message key="navigation.button.cancel"/></a>
					
				</div>
		</div>
		<div id="afterupdate"></div>
	</form:form>
</body>
